package com.ruoyi.animalManagement.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.animalManagement.mapper.LmisBuildingMapper;
import com.ruoyi.animalManagement.domain.LmisBuilding;
import com.ruoyi.animalManagement.service.ILmisBuildingService;

/**
 * 楼栋Service业务层处理
 * 
 * @author wj
 * @date 2025-08-17
 */
@Service
public class LmisBuildingServiceImpl implements ILmisBuildingService 
{
    @Autowired
    private LmisBuildingMapper lmisBuildingMapper;

    /**
     * 查询楼栋
     * 
     * @param buildingId 楼栋主键
     * @return 楼栋
     */
    @Override
    public LmisBuilding selectLmisBuildingByBuildingId(Long buildingId)
    {
        return lmisBuildingMapper.selectLmisBuildingByBuildingId(buildingId);
    }

    /**
     * 查询楼栋列表
     * 
     * @param lmisBuilding 楼栋
     * @return 楼栋
     */
    @Override
    public List<LmisBuilding> selectLmisBuildingList(LmisBuilding lmisBuilding)
    {
        return lmisBuildingMapper.selectLmisBuildingList(lmisBuilding);
    }

    /**
     * 新增楼栋
     * 
     * @param lmisBuilding 楼栋
     * @return 结果
     */
    @Override
    public int insertLmisBuilding(LmisBuilding lmisBuilding)
    {
        lmisBuilding.setCreateTime(DateUtils.getNowDate());
        lmisBuilding.setDelFlag("0");
        return lmisBuildingMapper.insertLmisBuilding(lmisBuilding);
    }

    /**
     * 修改楼栋
     * 
     * @param lmisBuilding 楼栋
     * @return 结果
     */
    @Override
    public int updateLmisBuilding(LmisBuilding lmisBuilding)
    {
        lmisBuilding.setUpdateTime(DateUtils.getNowDate());
        return lmisBuildingMapper.updateLmisBuilding(lmisBuilding);
    }

    /**
     * 批量删除楼栋
     * 
     * @param buildingIds 需要删除的楼栋主键
     * @return 结果
     */
    @Override
    public int deleteLmisBuildingByBuildingIds(Long[] buildingIds)
    {
        return lmisBuildingMapper.deleteLmisBuildingByBuildingIds(buildingIds);
    }

    /**
     * 删除楼栋信息
     * 
     * @param buildingId 楼栋主键
     * @return 结果
     */
    @Override
    public int deleteLmisBuildingByBuildingId(Long buildingId)
    {
        return lmisBuildingMapper.deleteLmisBuildingByBuildingId(buildingId);
    }
}
